package com.quectel.core.module.forum.entity.mongo;

import com.quectel.core.constants.MongoCollectionConstants;
import com.quectel.util.client.mongo.MongoBaseModel;
import lombok.Data;
import org.springframework.data.mongodb.core.index.CompoundIndex;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.MongoId;

import java.util.Date;

/**
 * @author zhangheng
 * @email nolan.zhang@quectel.com
 * @date 2023/5/8 15:52
 * @description 帖子点赞
 */
@Data
@Document(MongoCollectionConstants.FORUM_LIKE)
@CompoundIndex(name = "idx_post_person", def = "{'forumPostId': 1,'personId': 1}", background = true, unique = true)
public class ForumLikeModel implements MongoBaseModel {
    /**
     * id
     */
    @MongoId
    private Long id;

    /**
     * 帖子id
     */
    private Long forumPostId;

    /**
     * 点赞人id
     */
    private Long personId;

    /**
     * 点赞时间
     */
    private Date likeTime;


}
